//
//  SYMomentsTypeView.m
//  BShouGongKe
//
//  Created by lanou on 15/8/11.
//  Copyright (c) 2015年 L750. All rights reserved.
//

#import "SYMomentsTypeView.h"
#import "Header.h"



@implementation SYMomentsTypeView


- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        _hotLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 0.3, SCREEN_WIDTH, 40)];
        _hotLabel.font = [UIFont systemFontOfSize:15];
        _hotLabel.text = @"   最热";
        _arrowView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"arrowsTop@2x"]];
        _arrowView.frame = CGRectMake(55, 12, 15, 15);
        [_hotLabel addSubview:_arrowView];
        _pictureView = [[UIImageView alloc]init];
        _pictureView.frame = CGRectMake(SCREEN_WIDTH - 40, 5, 30, 30);
        _pictureView.backgroundColor = [UIColor grayColor];
        [_hotLabel addSubview:_pictureView];
        //[self handleStr:_hotLabel];
        [self addSubview:_hotLabel];
        
        _latestLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 40.6, SCREEN_WIDTH, 40)];
        _latestLabel.font = [UIFont systemFontOfSize:15];
        _latestLabel.text = @"   最新";
        //[self handleStr:_latestLabel];
        [self addSubview:_latestLabel];
        
        _qualityLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 80.9, SCREEN_WIDTH, 40)];
        _qualityLabel.font = [UIFont systemFontOfSize:15];
        _qualityLabel.text = @"   精品";
        //[self handleStr:_qualityLabel];
        [self addSubview:_qualityLabel];
        
        _lineView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 0.3)];
        _lineView.backgroundColor = [UIColor grayColor];
        _lineView1 = [[UIView alloc]initWithFrame:CGRectMake(0, 40.6, SCREEN_WIDTH, 0.3)];
        _lineView1.backgroundColor = [UIColor grayColor];
        _lineView2 = [[UIView alloc]initWithFrame:CGRectMake(0, 80.6, SCREEN_WIDTH, 0.3)];
        _lineView2.backgroundColor = [UIColor grayColor];
        _lineView3 = [[UIView alloc]initWithFrame:CGRectMake(0, 120.9, SCREEN_WIDTH, 1)];
        _lineView3.backgroundColor = [UIColor grayColor];
        [self addSubview:_lineView];
        [self addSubview:_lineView1];
        [self addSubview:_lineView2];
        [self addSubview:_lineView3];

        
    }
    return self;
}


- (void)handleStr:(UILabel *)label{
    NSMutableAttributedString *attributeStr = [[NSMutableAttributedString alloc]initWithString:label.text];
    NSMutableParagraphStyle *style = [[NSMutableParagraphStyle alloc]init];
    style.alignment = NSTextAlignmentLeft;
    [style setFirstLineHeadIndent:10.0];
    [attributeStr addAttribute:label.text value:style range:NSMakeRange(0, 2)];
    label.attributedText = attributeStr;
    [label sizeToFit];
}


@end
